package server

import (
	"fmt"
	"time"
)

func Run(stopCh <-chan struct{}) error {
	ticker := time.NewTicker(time.Duration(10) * time.Second)
	defer ticker.Stop()

	fmt.Println("Now run loop to clean data from redis")
	for {
		select {
		case <-ticker.C:
			fmt.Println("....ticket.....")
		// exit consumption cycle when receive SIGINT and SIGTERM signal
		case <-stopCh:
			fmt.Println("stop purge loop")
			return nil
		}
	}
}
